package com.xx.happychatboot.middleware.minio.service.Impl;


import com.xx.happychatboot.base.vo.response.ResponseDate;
import com.xx.happychatboot.middleware.minio.config.MinioUtils;
import com.xx.happychatboot.middleware.minio.service.MinIoService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
public class MinIoServiceImpl implements MinIoService {

    @Autowired
    private MinioUtils minioUtils;


    /**
     * 上传头像
     *
     * @param file
     * @return
     */
    @Override
    public ResponseDate uploadAvatar(MultipartFile file) throws Exception {
        String url = minioUtils.putObject(file);
        return ResponseDate.success("上传成功", url);
    }

}
